From cf9d7415abe59356baf7e792d5594c94aaa47696 Mon Sep 17 00:00:00 2001 From: "mjw@wray-m-3.hpl.hp.com" Date: Mon, 16 Aug 2004 09:32:12 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.67 (41207f1cCT7YHIMzP5SKhkRLzpuobA) Don't compress domain save files. Don't use O_EXCL. --- tools/libxutil/Makefile | 12 +++++------- tools/xfrd/xfrd.c | 18 +++++++----------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/tools/libxutil/Makefile b/tools/libxutil/Makefile index 8be24daa92..e3d15e85cb 100644 --- a/tools/libxutil/Makefile +++ b/tools/libxutil/Makefile @@ -27,16 +27,14 @@ MAJOR := 1.3 MINOR := 0 LIB_NAME := libxutil LIB := $(LIB_NAME).so -LIB += $(LIB_NAME).so.$(MAJOR) -LIB += $(LIB_NAME).so.$(MAJOR).$(MINOR) all: check-for-zlib $(LIB) -$(LIB_NAME).so: - ln -sf $(LIB_NAME).so.$(MAJOR) $@ +$(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR) + ln -sf $^ $@ -$(LIB_NAME).so.$(MAJOR): - ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $@ +$(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR) + ln -sf $^ $@ $(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_OBJS) $(CC) -Wl,-soname -Wl,$(LIB_NAME).so.$(MAJOR) -shared -o $@ $^ @@ -54,7 +52,7 @@ install: all install -m0755 $(LIB) $(prefix)/usr/lib clean: - $(RM) *.a *.so *.o *.rpm $(LIB) + $(RM) *.a *.so *.so.* *.o *.rpm $(RM) *~ $(RM) $(DEPS) diff --git a/tools/xfrd/xfrd.c b/tools/xfrd/xfrd.c index c5abcdcf1b..5f3b4752bf 100644 --- a/tools/xfrd/xfrd.c +++ b/tools/xfrd/xfrd.c @@ -738,22 +738,18 @@ int xfr_send(Args *args, XfrState *state, Conn *xend, uint32_t addr, uint32_t po */ int xfr_save(Args *args, XfrState *state, Conn *xend, char *file){ int err = 0; - int flags = (O_CREAT | O_EXCL | O_WRONLY); - int mode = 0644; - int fd; + int compress = 0; IOStream *io = NULL; dprintf("> file=%s\n", file); - fd = open(file, flags, mode); - if(fd < 0) { - eprintf("> Failed to open %s\n", file); - err = -EIO; - goto exit; + if(compress){ + io = gzip_stream_fopen(file, "wb1"); + } else { + io = file_stream_fopen(file, "wb"); } - io = gzip_stream_fdopen(fd, "wb1"); if(!io){ - eprintf("> Failed to allocate gzip state for %s\n", file); - err = -ENOMEM; + eprintf("> Failed to open %s\n", file); + err = -EINVAL; goto exit; } err = xen_domain_snd(xend, io, state->vmid, state->vmconfig, state->vmconfig_n); -- 2.30.2